
package com.yzp.service;

import com.yzp.entity.User;
import com.yzp.test1.dao.Test1UserMapper;
import com.yzp.test2.dao.Test2UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * @author White tea
 */
@Service
public class UserService {
    @Autowired
    private Test1UserMapper test1UserMapper;

    @Autowired
    private Test2UserMapper test2UserMapper;

    @Transactional(rollbackFor = Exception.class)
    public void createUser(User user) {
        System.out.println("createUser");
        test2UserMapper.insert(user);
        test1UserMapper.insert(user);
        System.out.println("创建用户成功...");
    }
}
